home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / ALTD201A.ZIP / VB4032.ZIP / VB40.32 / EX24VB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-19  |  8.3 KB  |  271 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "VB Example 24"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   1155
  6.    ClientTop       =   1635
  7.    ClientWidth     =   7260
  8.    Height          =   5070
  9.    Left            =   1095
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4665
  12.    ScaleWidth      =   7260
  13.    Top             =   1290
  14.    Width           =   7380
  15.    Begin VB.CommandButton UpdateZipComment 
  16.       Caption         =   "Update ZIP Comment"
  17.       Height          =   375
  18.       Left            =   5280
  19.       TabIndex        =   21
  20.       Top             =   600
  21.       Width           =   1815
  22.    End
  23.    Begin VB.CommandButton WriteDirectory 
  24.       Caption         =   "Write Directory"
  25.       Height          =   375
  26.       Left            =   5280
  27.       TabIndex        =   20
  28.       Top             =   1080
  29.       Width           =   1815
  30.    End
  31.    Begin VB.CommandButton UpdateFileComment 
  32.       Caption         =   "Update File Comment"
  33.       Height          =   375
  34.       Left            =   5280
  35.       TabIndex        =   19
  36.       Top             =   120
  37.       Width           =   1815
  38.    End
  39.    Begin VB.TextBox ArchiveComment 
  40.       Height          =   375
  41.       Left            =   1920
  42.       TabIndex        =   18
  43.       Text            =   "Archive Comment"
  44.       Top             =   3240
  45.       Width           =   1575
  46.    End
  47.    Begin VB.CommandButton Exit 
  48.       Caption         =   "Exit"
  49.       Height          =   375
  50.       Left            =   3720
  51.       TabIndex        =   17
  52.       Top             =   1080
  53.       Width           =   1335
  54.    End
  55.    Begin VB.CommandButton About 
  56.       Caption         =   "About"
  57.       Height          =   375
  58.       Left            =   3720
  59.       TabIndex        =   16
  60.       Top             =   600
  61.       Width           =   1335
  62.    End
  63.    Begin VB.TextBox Level 
  64.       Height          =   375
  65.       Left            =   3840
  66.       TabIndex        =   15
  67.       Text            =   "Level"
  68.       Top             =   1680
  69.       Width           =   1575
  70.    End
  71.    Begin VB.CheckBox Directory 
  72.       Caption         =   "Directory"
  73.       Height          =   375
  74.       Left            =   3840
  75.       TabIndex        =   14
  76.       Top             =   4200
  77.       Width           =   975
  78.    End
  79.    Begin VB.CheckBox Hidden 
  80.       Caption         =   "Hidden"
  81.       Height          =   375
  82.       Left            =   3840
  83.       TabIndex        =   13
  84.       Top             =   3720
  85.       Width           =   855
  86.    End
  87.    Begin VB.CheckBox System 
  88.       Caption         =   "System"
  89.       Height          =   375
  90.       Left            =   3840
  91.       TabIndex        =   12
  92.       Top             =   3240
  93.       Width           =   975
  94.    End
  95.    Begin VB.CheckBox Archive 
  96.       Caption         =   "Archive"
  97.       Height          =   375
  98.       Left            =   3840
  99.       TabIndex        =   11
  100.       Top             =   2760
  101.       Width           =   975
  102.    End
  103.    Begin VB.CheckBox ReadOnly 
  104.       Caption         =   "ReadOnly"
  105.       Height          =   375
  106.       Left            =   3840
  107.       TabIndex        =   10
  108.       Top             =   2280
  109.       Width           =   1095
  110.    End
  111.    Begin VB.TextBox TimeStamp 
  112.       Height          =   375
  113.       Left            =   1920
  114.       TabIndex        =   9
  115.       Text            =   "TimeStamp"
  116.       Top             =   2760
  117.       Width           =   1575
  118.    End
  119.    Begin VB.TextBox DateStamp 
  120.       Height          =   375
  121.       Left            =   1920
  122.       TabIndex        =   8
  123.       Text            =   "DateStamp"
  124.       Top             =   2280
  125.       Width           =   1575
  126.    End
  127.    Begin VB.TextBox crc 
  128.       Height          =   375
  129.       Left            =   240
  130.       TabIndex        =   7
  131.       Text            =   "crc"
  132.       Top             =   4200
  133.       Width           =   1575
  134.    End
  135.    Begin VB.TextBox Size 
  136.       Height          =   375
  137.       Left            =   240
  138.       TabIndex        =   6
  139.       Text            =   "Size"
  140.       Top             =   3240
  141.       Width           =   1575
  142.    End
  143.    Begin VB.TextBox CompressedSize 
  144.       Height          =   375
  145.       Left            =   240
  146.       TabIndex        =   5
  147.       Text            =   "CompressedSize"
  148.       Top             =   3720
  149.       Width           =   1575
  150.    End
  151.    Begin VB.TextBox Comment 
  152.       Height          =   375
  153.       Left            =   240
  154.       TabIndex        =   4
  155.       Text            =   "Comment"
  156.       Top             =   2760
  157.       Width           =   1575
  158.    End
  159.    Begin VB.TextBox FileName 
  160.       Height          =   375
  161.       Left            =   240
  162.       TabIndex        =   3
  163.       Text            =   "Text1"
  164.       Top             =   2280
  165.       Width           =   1575
  166.    End
  167.    Begin VB.ListBox Contents 
  168.       Height          =   2010
  169.       Left            =   1800
  170.       TabIndex        =   2
  171.       Top             =   120
  172.       Width           =   1695
  173.    End
  174.    Begin VB.CommandButton Command1 
  175.       Caption         =   "Read Archive"
  176.       Height          =   375
  177.       Left            =   3720
  178.       TabIndex        =   1
  179.       Top             =   120
  180.       Width           =   1335
  181.    End
  182.    Begin VB.FileListBox File1
  183.       Height          =   2010
  184.       Left            =   120
  185.       Pattern         =   "*.zip"
  186.       TabIndex        =   0
  187.       Top             =   120
  188.       Width           =   1575
  189.    End
  190. Attribute VB_Name = "Form1"
  191. Attribute VB_Creatable = False
  192. Attribute VB_Exposed = False
  193. Dim z() As ALZipDir
  194. Dim LibraryHandle As Long
  195. Private Sub About_Click()
  196.   frmAbout.Text1 = "EX24VB demonstrates the simplified interface.  Double click on a"
  197.   frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents.  Selecting individual"
  198.   frmAbout.Text1 = frmAbout.Text1 + " files shows the file's attributes.  You can change the"
  199.   frmAbout.Text1 = frmAbout.Text1 + " file and archive comments by inputing a new comment and"
  200.   frmAbout.Text1 = frmAbout.Text1 + " pressing the Update File/ZIP Comment button, then pressing"
  201.   frmAbout.Text1 = frmAbout.Text1 + " Write Directory."
  202.   frmAbout.Show 1
  203. End Sub
  204. Private Sub Command1_Click()
  205.     Dim i As Integer
  206.     Dim count As Long
  207.     Dim error As Long
  208.     ALFreeDir z()
  209.     If File1.filename <> "" Then
  210.         Contents.Clear
  211.         ALReadDir z(), File1.filename, count, error
  212.         For i = 0 To count - 1
  213.             Contents.AddItem (z(i).name)
  214.         Next i
  215.     End If
  216. ' I'm not going to do a WriteDir, a Delete, or
  217. ' anything like that, so I'll just free up the
  218. ' archive handle right away
  219.   ArchiveComment.text = z(UBound(z, 1)).comment
  220. End Sub
  221. Private Sub Contents_Click()
  222.     Dim i As Integer
  223.     i = Contents.ListIndex
  224.     If i >= LBound(z, 1) And i <= UBound(z, 1) Then
  225.         filename.text = z(i).name
  226.         comment.text = z(i).comment
  227.         size.text = Str(z(i).size)
  228.         CompressedSize.text = Str(z(i).compressed_size)
  229.         crc.text = Hex$(Not z(i).crc)
  230.         Datestamp.text = Format(z(i).month, "00/") + Format(z(i).date, "00/") + Format(z(i).year, "0000")
  231.         TimeStamp.text = Format(z(i).hour, "00:") + Format(z(i).minute, "00:") + Format(z(i).second, "00")
  232.         If z(i).r <> 0 Then ReadOnly.Value = 1 Else ReadOnly.Value = 0
  233.         If z(i).a <> 0 Then Archive.Value = 1 Else Archive.Value = 0
  234.         If z(i).s <> 0 Then System.Value = 1 Else System.Value = 0
  235.         If z(i).h <> 0 Then Hidden.Value = 1 Else Hidden.Value = 0
  236.         If z(i).d <> 0 Then Directory.Value = 1 Else Directory.Value = 0
  237.         level.text = Str(z(i).level)
  238.     End If
  239. End Sub
  240. Private Sub Exit_Click()
  241.   Unload Form1
  242.   End
  243. End Sub
  244. Private Sub File1_DblClick()
  245.     Command1_Click
  246. End Sub
  247. Private Sub Form_Load()
  248.     ChDrive App.Path
  249.     ChDir App.Path
  250.     File1.Path = App.Path
  251.     LibraryHandle = LoadLibrary(DLLName)
  252.     ReDim z(0)
  253. End Sub
  254. Private Sub Form_Unload(Cancel As Integer)
  255.   ALFreeDir z
  256.   FreeLibrary (LibraryHandle)
  257. End Sub
  258. Private Sub UpdateFileComment_Click()
  259.     Dim i As Integer
  260.     i = Contents.ListIndex
  261.     If i >= LBound(z, 1) And i <= UBound(z, 1) Then
  262.         z(i).comment = comment.text
  263.     End If
  264. End Sub
  265. Private Sub UpdateZipComment_Click()
  266.   z(UBound(z, 1)).comment = ArchiveComment.text
  267. End Sub
  268. Private Sub WriteDirectory_Click()
  269.     i = ALWriteDir(z())
  270. End Sub
  271.